package cn.cloud9;
public class Demo1CompareTwoTigerWeight {

    /**
     * https://www.bilibili.com/video/BV18J411W7cE?p=27
     * 判断两只老虎的体重是否相等？
     * @param args
     */
    public static void main(String[] args) {
        final int TIGER_1_WEIGHT = 200;
        final int TIGER_2_WEIGHT = 230;

        // 或者使用随机数
        // final Random RANDOM = new Random();
        // final int TIGER_1_WEIGHT = RANDOM.nextInt(100) + 1 + 100;
        // final int TIGER_2_WEIGHT = RANDOM.nextInt(100) + 1 + 100;

        // 使用三元
        boolean isEquals = TIGER_1_WEIGHT == TIGER_2_WEIGHT ? true : false;
        System.out.println(isEquals);

        // 直接获取
        isEquals = TIGER_1_WEIGHT == TIGER_2_WEIGHT;
        System.out.println(isEquals);
    }
}
